<?php

class Country_Model_DbTable_Polloptions extends Engine_Db_Table
{
  protected $_rowClass = 'Country_Model_Polloption';
  
    public function getPollOptions($poll_id){
        $select = $this->select()
                       ->where('poll_id = ?',$poll_id);
        $rows = $this->fetchAll($select);
        return $rows; 
    }
    
    public function getVoteOptions($poll_id,$country_id){
        $voteT = Engine_Api::_()->getDbtable('pollvotes','country');
        $select = $voteT->select()
                        ->where('poll_id = ?',$poll_id)
                        ->where('country_id = ?',$country_id);
        $rows = $voteT->fetchAll($select);
        return $rows;
    }
    
    public function deletePollOptions($poll_id){
        $this->delete(array(
            'poll_id = ?'=> $poll_id
        ));
    }
    
    
}
